﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.IO.IsolatedStorage;

namespace WriteText
{
    class Program
    {
        static void Main(string[] args)
        {
            MemoryStream ms = new MemoryStream();
            StreamWriter sw = new StreamWriter(ms);
             
            while (true)
            {
                string input = Console.ReadLine();
                if (input.Equals("quit"))
                    break;
                else
                    sw.WriteLine(input);
            }

            sw.Flush();

            IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly();
            IsolatedStorageFileStream isfs = new IsolatedStorageFileStream("testCoded.txt", FileMode.Create, isf);

            ms.WriteTo(isfs);
            ms.Flush();

            isfs.Close();
            sw.Close();
            ms.Close();
        }
    }
}
